Project Structure
BindAI projects provide a consistent way to organize agents, tools, workflows, knowledge, memory, templates, configuration, and tests. You can use BindAI components without creating a project, but a project provides a convenient structure for keeping an AI application organized as it grows.Creating a Project
Create a new project with the BindAI CLI:Default Project Layout
A BindAI application can be organized around the following structure:Project Files
main.py
main.py can serve as the application’s entry point.
A simple application can create an agent and execute it:
bindai.toml
bindai.toml is the project-level BindAI configuration file.
It can be used to keep application configuration separate from Python source code.
The exact configuration supported by a project depends on the BindAI version and the components being used.
Keep secrets such as API keys out of bindai.toml.
Use environment variables or another secure secret-management mechanism for credentials.
.env
The local .env file can contain environment variables required by the application.
For example:
Agents
Theagents/ directory can contain application-specific agent definitions.
For example:
Agent.builder():
Tools
Thetools/ directory can contain reusable tools used by agents.
For example:
tool decorator:
Workflows
Theworkflows/ directory can contain workflow-related application code.
For example:
- Agents
- Tools
- Conditional execution
- Loops
- Parallel execution
- Retries
- Timeouts
- Scheduling
- Human tasks
Knowledge
Theknowledge/ directory can contain application resources used by knowledge and retrieval systems.
For example:
- Document ingestion
- Parsing
- Chunking
- Embeddings
- Metadata
- Semantic retrieval
- BM25 retrieval
- Hybrid retrieval
- Filtering
- Reranking
- Conversational retrieval
- Knowledge pipelines
Memory
Thememory/ directory can be used to organize application-specific memory resources or implementations.
BindAI provides several memory implementations, including:
- In-memory memory
- SQLite
- PostgreSQL
- Vector memory
- Pinecone
- Chroma
- Conversation memory
- Custom memory implementations
Templates
Thetemplates/ directory can contain reusable application or workflow templates.
For example:
- Basic workflows
- Conditions
- Loops
- Parallel execution
- Human tasks
- Retries
- Timeouts
- Scheduling
Tests
Store project tests inside thetests/ directory.
For example:
Connections
Applications that communicate with external services can organize connection-related code separately from agents and workflows. BindAI’s Connections package currently provides integrations for:- Webhooks
- GitHub
- Slack
- Notion
- Jira
- Discord
- Resend
- Vercel
- Netlify
MCP
Applications using Model Context Protocol can keep MCP-related configuration and integration code separate from core agent logic. BindAI’s current MCP support includes:- MCP client connections
- Tool discovery
- Tool calling
- MCP tools exposed through the BindAI tool system
Organizing Larger Projects
As an application grows, organize components by responsibility. For example:Separating Responsibilities
A useful way to think about the project structure is:Multi-Agent Project Structure
Applications using multiple agents can organize specialists independently. For example:Environment and Source Control
Keep application secrets separate from source code. A typical project should include a.gitignore that excludes local environment files and other generated or sensitive content.
For example:
- API keys
- Access tokens
- Passwords
- Private credentials
- Other sensitive configuration
.env.example pattern can be used to document required environment variables without exposing their values.
Recommended Development Workflow
A typical BindAI project workflow is:- Create a project with
bindai new. - Configure the project’s environment.
- Configure the required provider.
- Build agents inside
agents/. - Add reusable tools inside
tools/. - Add memory when persistent or conversational state is required.
- Add knowledge and retrieval when application-specific information is required.
- Add workflows when execution requires multiple coordinated steps.
- Add Connections when external services are required.
- Add MCP integrations when external MCP tools are required.
- Add templates for reusable application patterns.
- Write tests inside
tests/. - Run the application with the BindAI CLI.
